package com.cn.intelligence.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.intelligence.pojo.Areas;
import com.cn.intelligence.pojo.Cities;
import com.cn.intelligence.pojo.Member;
import com.cn.intelligence.pojo.Provinces;
import com.cn.intelligence.pojo.TbUser;
import com.cn.intelligence.pojo.Wuliu;
import com.cn.intelligence.service.CommonService;

@Controller
@RequestMapping("/comm/")
public class CommonController {
	
	@Autowired
	CommonService commonService;
	
	/**
	 * 获取省份信息
	 * @param name
	 * @param id
	 * @return
	 */
	@RequestMapping("provinces")
	@ResponseBody
	public List<Provinces>  getProvinces(String name,String id){
		List<Provinces>  provinces = commonService.selectProvinces(name,id);
		return provinces;
	}
	/**
	 * 获取省份信息
	 * @param name
	 * @param id
	 * @return
	 */
	@RequestMapping("cities")
	@ResponseBody
	public List<Cities>  getCities(String name,String id){
		List<Cities>  cities = commonService.selectCities(name,id);
		return cities;
	}
	/**
	 * 获取省份信息
	 * @param name
	 * @param id
	 * @return
	 */
	@RequestMapping("areas")
	@ResponseBody
	public List<Areas>  getAreas(String name,String id){
		List<Areas>  areas = commonService.selectAreas(name,id);
		return areas;
	}
	/**
	 * 获取省份信息
	 * @param name
	 * @param id
	 * @return
	 */
	@RequestMapping("wuliu")
	@ResponseBody
	public List<Wuliu>  getWuLius(){
		List<Wuliu>  wuliu = commonService.selectgetWuLius();
		return wuliu;
	}
	/**
	 * 获取省份信息
	 * @param name
	 * @param id
	 * @return
	 */
	@RequestMapping("cususer")
	@ResponseBody
	public List<TbUser>  getCususer(){
		List<TbUser>  usetlist = commonService.selectgetCususer();
		return usetlist;
	}
	/**
	 * 获一级会员
	 * @param name
	 * @param id
	 * @return
	 */
	@RequestMapping("memberlevel")
	@ResponseBody
	public List<Member>  getMemberforLevel(){
		List<Member>  memberlsit = commonService.getMemberforLerevel();
		return memberlsit;
	}
	
}
